package com.ruoyi.project.syl_DZ.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.syl_DZ.domain.PatientLibrary;
import com.ruoyi.project.syl_DZ.service.IPatientLibraryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author:author
 * @date: 20:24 2021/7/13
 */
@RestController
@RequestMapping("/syl_DZ/patientLibrary")
public class PatientLibraryController extends BaseController {
    @Autowired
    private IPatientLibraryService patientLibraryService;
    /**
     *查询患者库列表
     */
    @PreAuthorize("@ss.hasPermi('syl_DZ:patientLibrary:query')")
    @GetMapping("/list")
    public TableDataInfo list(PatientLibrary patientLibrary){
        // 分页相关，处理请求参数pageNum,pageSize等。并使用PageHelper处理分页查询你
        startPage();
        // 调用service查询数据库
        List<PatientLibrary> list=patientLibraryService.findList(patientLibrary);
        // 返回
        return getDataTable(list);
    }
}
